<?php

/**
 * 地区
 *
 * Created by PhpStorm.
 * User: evan
 * Date: 16/9/7
 * Time: 上午4:24
 */
class Region extends MY_Api_Controller
{
    /**
     * 国家
     */
    public function country()
    {
        $this->load->service('common/service_common_region');
        $data = $this->service_common_region->country();


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 省份
     */
    public function province()
    {
        $cid = (int)$this->input->get_post('cid');


        $this->load->service('common/service_common_region');
        $data = $this->service_common_region->province($cid);


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 城市
     */
    public function city()
    {
        $pid = (int)$this->input->get_post('pid');


        $this->load->service('common/service_common_region');
        $data = $this->service_common_region->city($pid);


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 区域
     */
    public function district()
    {
        $cid = (int)$this->input->get_post('cid');


        $this->load->service('common/service_common_region');
        $data = $this->service_common_region->district($cid);


        $this->json_output($data['data'], $data['status']);
    }
}